import service from "../../utils/service";
/**
 * get: 获取店铺列表
 * path: /ranstore/store/queryStoreList
 * param: name - {int} 店铺名称
 * param: coordinate_latitude - {float} 用户坐标纬度
 * param: coordinate_longitude - {float} 用户坐标经度
 * param: page - {int} 页码，必填
 * param: page_size - {int} 每页显示的数量，必填
 * param: order_field - {string} 排序字段 id|name|build_at|distance，默认distance
 * param: order_type - {string} 排序方式 desc:降序|asc:升序，默认desc
 */
const queryStoreList = (data) => {
  return service({
    method: "get",
    url: "/ranstore/store/queryStoreList",
    data
  });
};

/**
 * get: 获取染发项目列表（染膏类型、染膏颜色、染发区域）
 * path: /ranstore/store/queryProjectList
 * param: ran_store_id - {int} 店铺id，必填
 */
const queryProjectList = (data) => {
  return service({
    method: "get",
    url: "/ranstore/store/queryProjectList",
    data
  });
};

/**
 * get: 获取店铺营业日期列表
 * path: /ranstore/store/queryBusinessDateList
 * param: ran_store_id - {int} 店铺id，必填
 * param: start_date - {date} 日期 2025-03-12，选填
 * param: end_date - {date} 日期 2025-03-31，选填
 */
const queryBusinessDateList = (data) => {
  return service({
    method: "get",
    url: "/ranstore/store/queryBusinessDateList",
    data
  });
};

/**
 * get: 获取预约时间块列表
 * path: /ranstore/store/queryTimeBlockList
 * param: ran_store_id - {int} 店铺id，必填
 * param: ran_store_employee_id - {int} 店员ID
 * param: date - {date} 日期 2025-03-12，必填
 */
const queryTimeBlockList = (data) => {
  return service({
    method: "get",
    url: "/ranstore/store/queryTimeBlockList",
    data
  });
};

/**
 * get: 获取员工列表
 * path: /ranstore/store/queryEmployeeList
 * param: ran_store_id - {int} 店铺id，必填
 * param: name - {int} 员工姓名
 * param: page - {int} 页码，必填
 * param: page_size - {int} 每页显示的数量，必填
 * param: order_field - {string} 排序字段 id|name，id
 * param: order_type - {string} 排序方式 desc:降序|asc:升序，默认desc
 */
const queryEmployeeList = (data) => {
  return service({
    method: "get",
    url: "/ranstore/store/queryEmployeeList",
    data
  });
};

/**
 * get: 预估耗时 --- 获取项目计算时间
 * path: /ranstore/order/getProjectTime
 * param: ran_store_hairdye_type_id - {int} 染膏类型id，必填
 * param: ran_store_hairdye_color_id - {int} 染膏颜色id，必填
 * param: ran_store_hair_region_id - {int} 染发区域id，必填
 */
const getProjectTime = (data) => {
  return service({
    method: "get",
    url: "/ranstore/order/getProjectTime",
    data
  });
};

/**
 * get: 预估费用 --- 获取项目计算价格
 * path: /ranstore/order/getProjectPrice
 * param: ran_store_hairdye_type_id - {int} 染膏类型id，必填
 * param: ran_store_hairdye_color_id - {int} 染膏颜色id，必填
 * param: ran_store_hair_region_id - {int} 染发区域id，必填
 * param: buy_vip - {string} 购买vip 0：不购买,1：购买
 * param: coupon_ids - {string} 优惠券ID，多个用,隔开
 */
const getProjectPrice = (data) => {
  return service({
    method: "get",
    url: "/ranstore/order/getProjectPrice",
    data
  });
};

/**
 * post: 生成预约订单
 * path: /ranstore/order/createRanstoreReservationOrder
 * param: ran_store_id - {int} 店铺ID，必填
 * param: phone - {string} 电话号码，代客预约用到
 * param: ran_store_hairdye_type_id - {int} 染膏类型ID，必填
 * param: ran_store_hairdye_color_id - {int} 染膏颜色ID，必填
 * param: ran_store_hair_region_id - {int} 染发区域ID，必填
 * param: start_at - {string} 预约起始时间块时间，必填
 */
const createReservationOrder = (data) => {
  return service({
    method: "post",
    url: "/ranstore/order/createRanstoreReservationOrder",
    data
  });
};

/**
 * post: 修改预约订单
 * path: /ranstore/order/updateRanstoreReservationOrder
 * param: id - {int} 预约订单ID
 * param: ran_store_hairdye_type_id - {int} 染膏类型ID
 * param: ran_store_hairdye_color_id - {int} 染膏颜色ID
 * param: ran_store_hair_region_id - {int} 染发区域ID
 * param: status - {int}  预约订单状态 1：待开始,2：已取消,3：待完成,4：待支付,5：已支付
 * param: phone - {string} 电话号码，代客预约用到
 */
const updateReservationOrder = (data) => {
  return service({
    method: "post",
    url: "/ranstore/order/updateRanstoreReservationOrder",
    data
  });
};

/**
 * get: 获取预约订单详情
 * path: /ranstore/order/getRanstoreReservationOrderDetail
 * param: id - {int}  预约订单ID，必填
 */
const getReservationOrderDetail = (data) => {
  return service({
    method: "get",
    url: "/ranstore/order/getRanstoreReservationOrderDetail",
    data
  });
};

/**
 * get: 获取预约订单列表
 * path: /ranstore/order/queryRanstoreReservationOrderList
 * param: ran_store_id - {int} 店铺ID
 * param: ran_store_employee_id - {int} 店员ID
 * param: status - {int} 预约订单状态 1：待开始,2：已取消,3：待完成,4：待支付,5：已支付
 * param: start_time - {string} 订单创建时间开始 2025-04-23 10:54:39
 * param: end_time - {string} 订单创建时间结束 2025-04-24 10:54:39
 * param: page - {int} 页码，必填
 * param: page_size - {int} 每页显示的数量，必填
 * param: order_field - {string} 排序字段 id|finish_at，默认id
 * param: order_type - {string} 排序方式 desc:降序|asc:升序，默认desc
 */
const queryRanstoreReservationOrderList = (data) => {
  return service({
    method: "get",
    url: "/ranstore/order/queryRanstoreReservationOrderList",
    data
  });
};

/**
 * post: 生成vip会员支付订单
 * path: /ranstore/order/createRanstoreVipOrder
 * param: amount - {int} 产品金额（分），必填
 * param: scene - {int} 场景值写死（11） ,11第一个1代表微信支付第二个1代表jsapi，必填
 * param: product_name - {string} 商品名称这里写死（然博士染发会员卡），必填
 */
const createRanstoreVipOrder = (data) => {
  return service({
    method: "post",
    url: "/ranstore/order/createRanstoreVipOrder",
    data
  });
};

/**
 * post: 生成染发支付订单
 * path: /ranstore/order/createRanstorePayOrder
 * param: reservation_order_id - {int} 预约单号，必填
 * param: buy_vip - {string} 购买vip 0：不购买,1：购买
 * param: coupon_ids - {string} 优惠券ID，多个用,隔开
 * param: user_remark - {string} 用户备注
 * param: scene - {int} 场景值写死（11） ,11第一个1代表微信支付第二个1代码jsapi，必填
 * param: product_name - {string} 商品名称这里问产品看怎么按照染发选择命名，必填
 */
const createRanstorePayOrder = (data) => {
  return service({
    method: "post",
    url: "/ranstore/order/createRanstorePayOrder",
    data
  });
};


/**
 * get: 获取支付参数信息,用于没支付的订单再次调起支付
 * path: /ranstore/order/getPayInfo
 * param: id - {int} 订单ID，必填
 */
const getPayInfo = (data) => {
  return service({
    method: "get",
    url: "/ranstore/order/getPayInfo",
    data
  });
};

/**
 * get: 平台优惠券列表
 * path: /ranstore/coupon/queryCouponList
 * param: use_status - {int} 使用状态 1:待使用（is_used为0且未过期）|2:已失效（is_used为1或已过期），必填
 * param: type - {int} 折扣券类型 1:满减券|2:折扣券
 * param: page - {int} 页码，必填
 * param: page_size - {int} 每页显示的数量，必填
 * param: order_field - {string} 排序字段 'user_coupon.id|user_coupon.end_time|user_coupon.is_used，默认user_coupon.id
 * param: order_type - {string} 排序方式 desc:降序|asc:升序，默认desc
 */
const queryCouponList = (data) => {
  return service({
    method: "get",
    url: "/ranstore/coupon/queryCouponList",
    data
  });
};

/**
 * post: 用户领取优惠券
 * path: /ranstore/coupon/addUserCoupon
 * param: id - {int} 可领优惠券列表ID
 */
const addUserCoupon = (data) => {
  return service({
    method: "post",
    url: "/ranstore/coupon/addUserCoupon",
    data
  });
};

/**
 * get: 用户优惠券列表
 * path: /ranstore/coupon/queryUserCouponList
 * param: use_status - {int} 使用状态 1:待使用（is_used为0且未过期）|2:已失效（is_used为1或已过期），必填
 * param: type - {int} 折扣券类型 1:满减券|2:折扣券
 * param: buy_vip - {string} 购买vip 0：不购买,1：购买
 * param: page - {int} 页码，必填
 * param: page_size - {int} 每页显示的数量，必填
 * param: order_field - {string} 排序字段 'user_coupon.id|user_coupon.end_time|user_coupon.is_used，默认user_coupon.id
 * param: order_type - {string} 排序方式 desc:降序|asc:升序，默认desc
 */
const queryUserCouponList = (data) => {
  return service({
    method: "get",
    url: "/ranstore/coupon/queryUserCouponList",
    data
  });
};

/**
 * get: 获取vip价格
 * path: /ranstore/order/getVipPrice
 * param: type - {int}  会员类型 1：普通会员，2：超级会员
 */
const getVipPrice = (data) => {
  return service({
    method: "get",
    url: "/ranstore/order/getVipPrice",
    data
  });
};
export default {
  queryStoreList,
  queryProjectList,
  queryBusinessDateList,
  queryTimeBlockList,
  queryEmployeeList,
  getProjectTime,
  getProjectPrice,
  createReservationOrder,
  updateReservationOrder,
  getReservationOrderDetail,
  queryRanstoreReservationOrderList,
  createRanstoreVipOrder,
  createRanstorePayOrder,
  getPayInfo,
  queryCouponList,
  addUserCoupon,
  queryUserCouponList,
  getVipPrice,
};
